﻿using B.S.DataBase.MyProject.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using T.E.ERP.Write.API.Applicantions.Command.VendorsCommand;

namespace T.E.ERP.Write.API.Controllers
{
    /// <summary>
    /// 原料供应商写的控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MAddSuppliController : ControllerBase
    {

        private readonly IMediator mediator;

        public MAddSuppliController(IMediator mediator)
        {
            this.mediator = mediator;
        }


        /// <summary>
        /// 原料供应商添加方法
        /// </summary>
        /// <param name="add"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<APIResult<object>> AddSuppli(AddMateriCommand add)
        {
            return await mediator.Send(add);
        }
    }
}
